﻿<!DOCTYPE html>
<html>
<head>
    <!-- Force latest IE rendering engine or ChromeFrame if installed -->
    <!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><![endif]-->
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <title>@ViewBag.Title</title>
    <link href="~/Contents/Styles/Plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="~/Contents/Styles/Plugins/bootstrap/css/bootstrap-theme.min.css" rel="stylesheet" />
    <link href="~/Contents/Styles/Plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
    <link href="~/Contents/Styles/lib.css" rel="stylesheet" />
    @RenderSection("CSS", false)
    <!-- Bootstrap CSS fixes for IE6 -->
    <!--[if lt IE 7]><link rel="stylesheet" href="/Content/FileUpload/css/bootstrap/bootstrap-ie6.debug.css"><![endif]-->
    <!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>
<body>
    <!-- Menu-->
    <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#my-navbar">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    @*<span class="icon-bar"></span>*@
                    <span class="icon-bar"></span>
                </button>
                <!-- Logo -->
                <a class="navbar-brand logo-nav" href="/">
                    <img src="~/Contents/Image/LOGO-TTKT.png"></a><!-- /.Logo -->
            </div>

            <div id="my-navbar" class="collapse navbar-collapse">
                <ul class="nav navbar-nav navbar-right">
                    <li><a href="/"><i class="fa fa-home home"></i>Trang chủ</a></li>
                    <li><a href="http://ttkt.vtv.net" target="_blank">TTKT Site</a></li>
                    @if (HttpContext.Current.User.Identity.IsAuthenticated)
                    {
                        <li id="authenticatedAction" class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-user home"></i>Xin chào: @(HttpContext.Current.User.Identity.Name + " ")<b class="caret"></b></a>
                            <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
                                @*<li><a href="#"><i class="fa fa-envelope home"></i>Thông báo <span class="badge">7</span></a></li>*@
                                <li><a href="#"><i class="fa fa-wrench home"></i>Cài đặt tài khoản</a></li>
                                @if (User.IsInRole("Lib Admin"))
                                {
                                    <li><a href="/admin/documents"><i class="fa fa-pencil-square-o home"></i>Quản lý tài liệu</a></li>                                    
                                }
                                else if (User.IsInRole("System Admin"))
                                {
                                    <li><a href="/admin/documents"><i class="fa fa-cog fa-spin home"></i>Quản trị hệ thống</a></li>
                                }                               
                                <li class="divider"></li>
                                <li><a href="#"><i class="fa fa-power-off home"></i>Đăng xuất</a></li>
                            </ul>
                        </li>
                    }
                    else
                    {
                        <li><a  id="showLoginModal" href="#">Đăng nhập</a></li>
                    }
                </ul>
            </div>
            <!-- /.navbar-collapse -->
        </div>
    </nav>
    <!-- /. End Menu-->

    <!-- Search box-->
    <div class="container myslide" style="margin-top: 3px;">
        <div class="row">
            <div class="col-lg-6 col-md-8 col-sm-8 col-xs-12 pull-right">
                <div class="input-group">
                    <input type="text" id="mainSearch" class="form-control" placeholder="Tìm kiếm tài liệu" data-provide="typeahead" autocomplete="off">
                    <span class="input-group-btn">
                        <a id="search2" href="#" class="btn btn-default" type="button"><span class="glyphicon glyphicon-search"></span></a>
                        <button class="btn btn-default" type="button">Nâng cao</button>
                    </span>
                </div>
            </div>
        </div>
    </div>
    <!-- /. End Search box-->

    <div class="container">
        @RenderSection("Slide", false)

        <!-- Page memo-->
        <div class="main-info">
            <div class="container">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="text-center">
                            <span>THƯ VIỆN KỸ THUẬT</span>
                            <h4>TRUNG TÂM KỸ THUẬT SẢN XUẤT CHƯƠNG TRÌNH</h4>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- /. End Page memo-->

        <hr>

        @RenderBody()

        <hr>

        <!-- Footer-->
        <footer>
            <div class="row">
                <div class="col-lg-12">
                    <p>Copyright &copy; 2013 Bản quyền thuộc Trung tâm Kỹ thuật Sản xuất Chương trình </p>
                    <h4><small>Địa chỉ: 43 - Nguyễn Chí Thanh - Ba Đình - Hà Nội. Điện thoại: 7.716732. Fax: 8.318113 </small></h4>
                </div>
            </div>
        </footer>
        <!-- /. End Footer-->
    </div>

    <!-- Common Modal -->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="myModalLabel">Modal title</h4>
                </div>
                <div id="myModalBody" class="modal-body">
                </div>
                <div class="modal-footer">
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
    </div>
    <!-- /.modal -->

    <!-- Login-->
    <div class="modal fade" id="loginModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title"><i class="fa fa-lock fa-2x" style="margin-right: 25px; color: yellowgreen"></i>Đăng nhập</h4>
                </div>
                <div class="modal-body">   
                    <div id="loginModal-alerts">
                    </div>                 
                    <div class="form-group">
                        <label for="username">Tài khoản</label>
                        <input type="text" class="form-control" id="username" placeholder="Nhập tài khoản">
                    </div>
                    <div class="form-group">
                        <label for="password">Mật khẩu</label>
                        <input type="password" class="form-control" id="password" placeholder="Nhập mật khẩu">
                    </div>
                    <div class="checkbox">
                        <label>
                            <input type="checkbox">
                            Duy trì đăng nhập
                        </label>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">Hủy</button>
                    <button type="button" class="btn btn-primary">Đăng nhập</button>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
    </div>
    <!-- /.modal -->


    <script src="~/Scripts/Plugins/jquery-1.10.2.min.js"></script>
    <script src="~/Scripts/Plugins/bootstrap.min.js"></script>
    <script src="~/Scripts/Plugins/bootstrap-paginator.min.js"></script>
    <script src="~/Scripts/Plugins/typeahead.min.js"></script>
    <script src="~/Scripts/App/DataService.js"></script>
    <script src="~/Scripts/App/LibDocuments/ModalVideo.js"></script>
    <script src="~/Scripts/App/AuthenService.js"></script>
    <script>
        $('#mainSearch').typeahead({
            name: 'data',
            valueKey: 'DocumentName',
            remote: '/documents/search1/%QUERY'
        });
        var userName = '@(Request.IsAuthenticated ? HttpContext.Current.User.Identity.Name : "")';
        var authenSerivce = new AuthenService(userName);
        authenSerivce.Init();

        $('#search2').click(function () {            
            var searchKey = $('#mainSearch').val();
            if (searchKey != null && searchKey.length > 0 && searchKey.trim().length > 0) {
                $(this).attr('href', '/documents/search2/' + searchKey);
            }
        })
    </script>
    @RenderSection("JS", false)
</body>
</html>
